home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / mktemp.man < prev    next >
Encoding:
Text File  |  1990-03-22  |  1.5 KB  |  67 lines

  1.  
  2.  
  3.  
  4. MKTEMP                C Library Procedures                 MKTEMP
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      mktemp, mkstemp - make a unique file name
  10.  
  11. SSYYNNOOPPSSIISS
  12.      cchhaarr **mmkktteemmpp((tteemmppllaattee))
  13.      cchhaarr **tteemmppllaattee;;
  14.  
  15.      mmkksstteemmpp((tteemmppllaattee))
  16.      cchhaarr **tteemmppllaattee;;
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      _M_k_t_e_m_p creates a unique file name and returns the address of
  20.      the template.  The template should contain a file name with
  21.      trailing _X's, normally something like /_t_m_p/_t_e_m_p_X_X_X_X_X_X.  The
  22.      _X's are replaced by the current process number and/or a
  23.      unique letter combination.  _M_k_s_t_e_m_p makes the same replace-
  24.      ment to the template but opens the template file and returns
  25.      a file descriptor open for reading and writing.  _M_k_s_t_e_m_p
  26.      avoids the race between testing whether the file exists and
  27.      opening it for use.  The number of file name combinations
  28.      _m_k_t_e_m_p and _m_k_s_t_e_m_p will try depends on the number of _X's
  29.      placed on the end of the template; six _X's will result in
  30.      them trying roughly 26 ** 6 combinations.
  31.  
  32. SSEEEE AALLSSOO
  33.      access(2), getpid(2), open(2)
  34.  
  35. DDIIAAGGNNOOSSTTIICCSS
  36.      _M_k_t_e_m_p returns NULL on failure, _m_k_s_t_e_m_p returns -1 if no
  37.      suitable file could be created.
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0              April 10, 1987                         1
  64.  
  65.  
  66.  
  67.